package bitmap

type BitMap []int

func NewBitMap(max int) BitMap {
	bitmap := make(BitMap, (max + 64) >> 6)
	return bitmap
}

func (b BitMap) Add (val int) {
	b[val>>6] |= 1<<(val&63)
}

func (b BitMap) Delete (val int) {
	b[val>>6] &= ^(1<<(val&63))
}

func (b BitMap) IsContain (val int) bool {
	if b[val>>6] & (1<<(val&63)) == 0 {
		return false
	}
	return true
}

